<!DOCTYPE html>
<html>
<head>
<title>Charge Distribution Diagram</title>
</head>
<body>
<canvas id="physicsCanvas" width="500" height="350"></canvas>
<script>
    const canvas = document.getElementById('physicsCanvas');
    const ctx = canvas.getContext('2d');

    // Set a white background
    ctx.fillStyle = 'white';
    ctx.fillRect(0, 0, canvas.width, canvas.height);

    // Define parameters based on the image
    const cx = 190;
    const cy = 170;
    const chargeRadius = 10;
    const shellInnerRadius = 80;
    const shellOuterRadius = 110;
    const shellMidRadius = (shellInnerRadius + shellOuterRadius) / 2;
    const shellThickness = shellOuterRadius - shellInnerRadius;
    const pointRadius = 3.5;

    // --- Draw the Spherical Shell ---
    // The shell is drawn as a thick stroked arc
    ctx.beginPath();
    ctx.arc(cx, cy, shellMidRadius, 0, 2 * Math.PI);
    ctx.strokeStyle = 'rgb(189, 189, 189)'; // A light gray color matching the image
    ctx.lineWidth = shellThickness;
    ctx.stroke();

    // --- Draw the Central Point Charge ---
    ctx.beginPath();
    ctx.arc(cx, cy, chargeRadius, 0, 2 * Math.PI);
    ctx.fillStyle = 'black';
    ctx.fill();

    // --- Define positions for points W, X, Y, Z ---
    // Positions are calculated relative to the center and shell radii to be physically correct.
    // W is inside the cavity, X is inside the shell conductor, Y and Z are outside.
    const posW = cx + 55;
    const posX = cx + shellMidRadius; 
    const posY = cx + shellOuterRadius + 40;
    const posZ = posY + 45;

    // --- Draw the Points W, X, Y, Z as black dots ---
    // These dots represent the specific locations in space.
    ctx.fillStyle = 'black';
    
    // Point W
    ctx.beginPath();
    ctx.arc(posW, cy, pointRadius, 0, 2 * Math.PI);
    ctx.fill();

    // Point X
    ctx.beginPath();
    ctx.arc(posX, cy, pointRadius, 0, 2 * Math.PI);
    ctx.fill();

    // Point Y
    ctx.beginPath();
    ctx.arc(posY, cy, pointRadius, 0, 2 * Math.PI);
    ctx.fill();

    // Point Z
    ctx.beginPath();
    ctx.arc(posZ, cy, pointRadius, 0, 2 * Math.PI);
    ctx.fill();

    // --- Add Labels ---
    ctx.fillStyle = 'black';
    ctx.textAlign = 'center';

    // Charge labels
    ctx.font = '28px serif';
    ctx.fillText('-Q', cx - 15, cy + chargeRadius + 30);
    ctx.fillText('+Q', cx - shellOuterRadius - 15, cy + 45);

    // Point labels, placed above the corresponding points for clarity.
    ctx.font = '32px serif';
    ctx.textBaseline = 'bottom';
    ctx.fillText('W', posW, cy - 8);
    ctx.fillText('X', posX, cy - 8);
    ctx.fillText('Y', posY, cy - 8);
    ctx.fillText('Z', posZ, cy - 8);

</script>
</body>
</html>